from django.contrib import admin
from .models import Tags, Category, Blog, Contact


# Register your models here.

@admin.register(Tags)
class TagAdmin(admin.ModelAdmin):
    list_display = ['id', 'name']
    list_display_links = ['name']
    fields = ['name']


@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
    list_display = ['id', 'name']
    list_display_links = ['name']
    fields = ['name']


@admin.register(Blog)
class BlogAdmin(admin.ModelAdmin):
    list_display = ['id', 'title', 'author', 'total_views', 'tag', 'category', 'is_recommend', 'created']
    list_display_links = ['title']
    fields = ['title', 'desc', 'body', 'author', 'total_views', 'image', 'tag', 'category', 'created', 'is_recommend']


@admin.register(Contact)
class ContactAdmin(admin.ModelAdmin):
    list_display = ['email', 'qq', 'introduce']
    list_display_links = ['email', 'qq', 'introduce']
    fields = ['email', 'qq', 'introduce', 'we_chat']


admin.site.site_title = "博客后台"
admin.site.site_header = "博客管理系统"

